package com.bulk.str;

import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;

/**
 * string 字符串相关操作
 *
 * @author 散装java
 */
public class SplitStr {
    public static void main(String[] args) {
        String str = "_name";
        String[] s = str.split("_");
        System.out.println(JSONUtil.toJsonStr(s));
        System.out.println("out1 = " + s[0]);
        System.out.println("out2 = " + s[1]);
        String str2 = "name_";
        String[] s1 = str2.split("_");
        System.out.println("out3 = " + s1[0]);
//        System.out.println("out4 = " + s1[1]); 此行 异常
        String str4 = "";
        System.out.println("StrUtil.isNotEmpty(str) = " + StrUtil.isNotEmpty(str4));

        String s2 = JSONUtil.escape("\"k5=v5\";k6=v6");
        System.out.println(s2);

    }
}
